import React from 'react';
import Layout from '@/components/Layout';
import Aside from '@/components/Aside';
import Menu from '@/components/containers/MenuContainer';

export default function index({ location, children, history }) {
  if (location.pathname === '/login') {
    return children;
  }
  return (
    <Layout
      header={<Menu onLoginOut={() => history.push('/login')} />}
      aside={<Aside />}
    >
      {children}
    </Layout>
  );
}
